import $http from '@/http'

export const passwordLogin = (data, success) => $http.post('/app-api/risk/mp-user/create', data, success)

//发送短信验证码
export const sendSmsValidCode = (data, success) => $http.post('/app-api/sms/sendSmsCode', data, success)
export const validateSmsCode = (data) => $http.postPromise('/app-api/sms/validateSmsCode', data)


//获得警员信息
export const getpoliceman = (data, success) => $http.get('/app-api/risk/policeman/get', data, success)

//获得微信用户
export const getuserinfo = (openid, success) => $http.get('/app-api/risk/mp-user/getMpUser?openid=' + openid, success)
export const getuserinfoPromise = (openid, success) => $http.getPromise('/app-api/risk/mp-user/getMpUser?openid=' + openid, success)


//删除微信用户
export const deleteuserinfo = (id, success) => $http.delete('/app-api/risk/mp-user/delete?id=' + id, success)

//创建交通问题
export const createProblem = (data, success) => $http.post('/app-api/risk/traffic-problem/create', data, success)

//修改交通问题
export const updateProblem = (data, success) => $http.put('/app-api/risk/traffic-problem/update', data, success)

//获得交通问题分页
export const myTrafficProblem = (params, success) => $http.get('/app-api/risk/traffic-problem/myTrafficProblem', params, success)

//获得交通问题
export const getProblem = (id, success) => $http.get('/app-api/risk/traffic-problem/get?id=' + id, success)

//上传
export const upload = (data, success) => $http.post('/app-api/infra/file/upload', data, success)


//根据字典类型查询字典数据信息
export const dictData = (type, success) => $http.getPromise('/app-api/system/dict-data/type?type=' + type, success)
export const opsPage = (dlmc) => $http.getPromise('/app-api/traffic/ops-road/page?dlmc=' + dlmc + '&pageSize=100&pageNo=1')

//根据道路编号查询
export const getTrafficIntersectionPage = (dldm) => $http.getPromise('app-api/traffic/ops-road/getTrafficIntersectionPage?dldm=' + dldm + '&pageSize=100&pageNo=1')

//获取微信Js Sdk签名信息
export const getWechatJsSdkSignatureInfo = (desUrl, success) => $http.get('/app-api/wechat/getWeixinJssdkSignatureInfo?desUrl=' + desUrl, success)
// export const getWechatJsSdkSignatureInfo = (desUrl, success) => $http.get('https://dmv.xiaoluxueche.com/dmv/api/v1/wechat/getWeixinJssdkSignatureInfo?desUrl=' + desUrl, success)


//获得当前部门下的子部门
export const getChildDeptList = (parentId) => $http.getPromise('/app-api/system/dept/getChildDeptList?parentId=' + parentId)
